﻿<#--
分析xml实体定义文件，转化成实体模型
定义各个annotations
-->
<@pp.dropOutputFile />
<#assign project = pp.newWritableHash()>
<@pp.set hash=project key="name" value=doc.project.@name!("testProject") />
<@pp.set hash=project key="basepackage" value=doc.project.@basepackage!("com.codegen") />
<@pp.set hash=project key="author" value=doc.project.@author!("suwu") />

<#if doc.project.database[0]??>
	<@pp.set hash=project key="database" value=pp.newWritableHash() />
		<#if doc.project.database.@dbtype[0]??>
			<@pp.set hash=project.database key="dbtype" value=doc.project.database.@dbtype />
		</#if>		
		<#if doc.project.database.@driver[0]??>
			<@pp.set hash=project.database key="driver" value=doc.project.database.@driver />
		</#if>		
		<#if doc.project.database.@url[0]??>
			<@pp.set hash=project.database key="url" value=doc.project.database.@url />
		</#if>		
		<#if doc.project.database.@username[0]??>
			<@pp.set hash=project.database key="username" value=doc.project.database.@username />
		</#if>		
		<#if doc.project.database.@password[0]??>
			<@pp.set hash=project.database key="password" value=doc.project.database.@password />
		</#if>		
		<#if doc.project.database.hibernate[0]??>
			<@pp.set hash=project.database key="hibernate" value=pp.newWritableHash() />
		</#if>			
		<#if doc.project.database.hibernate.@dialect[0]??>
			<@pp.set hash=project.database.hibernate key="dialect" value=doc.project.database.hibernate.@dialect />
		</#if>			
		<#if doc.project.database.hibernate.@show_sql[0]??>
			<@pp.set hash=project.database.hibernate key="show_sql" value=doc.project.database.hibernate.@show_sql />
		</#if>			
		<#if doc.project.database.hibernate.@cache_provider_class[0]??>
			<@pp.set hash=project.database.hibernate key="cache_provider_class" value=doc.project.database.hibernate.@cache_provider_class />
		</#if>			
		<#if doc.project.database.hibernate.@cache_use_query_cache[0]??>
			<@pp.set hash=project.database.hibernate key="cache_use_query_cache" value=doc.project.database.hibernate.@cache_use_query_cache />
		</#if>	
</#if>

<#if doc.project.test[0]??>
	<@pp.set hash=project key="test" value=pp.newWritableHash() />  
		<#if doc.project.test.@selenium_explorer[0]??>
			<@pp.set hash=project.test key="selenium_explorer" value=doc.project.test.@selenium_explorer />
		</#if>	
</#if>	
<@pp.set hash=project key="entities" value=pp.newWritableSequence()/>

<#assign i = 0>
<#list doc.project.entity as e>
  <#-- -->
  <@pp.add seq=project.entities index=i value=pp.newWritableHash() />
    <#--处理entity元素中的属性 -->
    <#if e.@className[0]??>
      <@pp.set hash=project.entities[i] key="className" value= e.@className />
    </#if>    
    <#if e.@mappedSuperClass[0]??>
    	<#if e.@mappedSuperClass?trim?lower_case == "true">
      	<@pp.set hash=project.entities[i] key="mappedSuperClass" value= true />  
      <#else>
      	<@pp.set hash=project.entities[i] key="mappedSuperClass" value= false />  
      </#if>		
    </#if>
    <#if e.@embeddable[0]??>
    	<#if e.@embeddable?trim?lower_case == "true">
      	<@pp.set hash=project.entities[i] key="embeddable" value= true />  
      <#else>
      	<@pp.set hash=project.entities[i] key="embeddable" value= false />  
      </#if>		 
    </#if>  
    <#if e.@inheritance[0]??>
      <@pp.set hash=project.entities[i] key="inheritance" value= e.@inheritance />  
    </#if>  
    <#if e.@discriminatorValue[0]??>
      <@pp.set hash=project.entities[i] key="discriminatorValue" value= e.@discriminatorValue />  
    </#if>
    <#if e.@idClass[0]??>
      <@pp.set hash=project.entities[i] key="idClass" value= e.@idClass />  
    </#if>    
    <#if e.@extends[0]??>
      <@pp.set hash=project.entities[i] key="extends" value= e.@extends />  
    </#if>
    <#if e.@implements[0]??>
      <@pp.set hash=project.entities[i] key="implements" value= e.@implements />  
    </#if>  
    <#if e.@package[0]??>
      <@pp.set hash=project.entities[i] key="package" value= e.@package />  
    <#else>
      <@pp.set hash=project.entities[i] key="package" value= project.basepackage + ".model" />  
    </#if>  
    
    
    <#--处理entity中discriminatorColumnt子元素及其属性 -->
    <#if e.discriminatorColumn[0]??>
      <@pp.set hash=project.entities[i] key="discriminatorColumn" value= pp.newWritableHash() />
      
      <#if e.discriminatorColumn.@name[0]??>
        <@pp.set hash=project.entities[i].discriminatorColumn key="name" value= e.discriminatorColumn.@name />  
      </#if>  
      <#if e.discriminatorColumn.@discriminatorType[0]??>
        <@pp.set hash=project.entities[i].discriminatorColumn key="discriminatorType" value= e.discriminatorColumn.@discriminatorType />  
      </#if>  
      <#if e.discriminatorColumn.@columnDefinition[0]??>
        <@pp.set hash=project.entities[i].discriminatorColumn key="columnDefinition" value= e.discriminatorColumn.@columnDefinition />  
      </#if>
      <#if e.discriminatorColumn.@length[0]??>
        <@pp.set hash=project.entities[i].discriminatorColumn key="length" value= e.discriminatorColumn.@length />  
      </#if>  
    </#if>
    
    <#--处理entity中primaryKeyJoinColumn子元素及其属性 -->
    <#if e.primaryKeyJoinColumn[0]??>
      <@pp.set hash=project.entities[i] key="primaryKeyJoinColumns" value= pp.newWritableSequence() />
      
			<#assign p1 = 0>
			<#list e.primaryKeyJoinColumn as primaryKeyJoinColumn>
			  <@pp.add seq=project.entities[i].primaryKeyJoinColumns index=p1 value=pp.newWritableHash() />
			    
	      <#if primaryKeyJoinColumn.@name[0]??>
	        <@pp.set hash=project.entities[i].primaryKeyJoinColumns[p1] key="name" value= primaryKeyJoinColumn.@name />  
	      </#if>  
	      <#if primaryKeyJoinColumn.@referencedColumnName[0]??>
	        <@pp.set hash=project.entities[i].primaryKeyJoinColumns[p1] key="referencedColumnName" value= primaryKeyJoinColumn.@referencedColumnName />  
	      </#if>  
	      <#if primaryKeyJoinColumn.@columnDefinition[0]??>
	        <@pp.set hash=project.entities[i].primaryKeyJoinColumns[p1] key="columnDefinition" value= primaryKeyJoinColumn.@columnDefinition />  
	      </#if> 
			  <#assign p1 = p1 + 1>
			</#list>
		</#if>	    
        	
    <#--处理entity元素中attributeOverride子元素-->
    <#if e.attributeOverride[0]??>
			<@pp.set hash=project.entities[i] key="attributeOverrides" value=pp.newWritableSequence()/>
			
			<#assign i1 = 0>
			<#list e.attributeOverride as ao>
			  <#-- -->
			  <@pp.add seq=project.entities[i].attributeOverrides index=i1 value=pp.newWritableHash() />
			    <#--处理entity元素中的属性 -->
			    <#if ao.@name[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1] key="name" value= ao.@name />
			    </#if>
			  <@pp.set hash=project.entities[i].attributeOverrides[i1]  key="column" value=pp.newWritableHash() />
			    
			    <#if ao.@columnName[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="name" value= ao.@columnName />
			    </#if>  
			    <#if ao.@unique[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="unique" value= ao.@unique />
			    </#if>  
			    <#if ao.@name[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="name" value= ao.@name />
			    </#if>  
			    <#if ao.@nullable[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="nullable" value= ao.@nullable />
			    </#if>  
			    <#if ao.@insertable[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="insertable" value= ao.@insertable />
			    </#if>  
			    <#if ao.@updatable[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="updatable" value= ao.@updatable />
			    </#if>  
			    <#if ao.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="columnDefinition" value= ao.@columnDefinition />
			    </#if>  
			    <#if ao.@table[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="table" value= ao.@table />
			    </#if>  
			    <#if ao.@length[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="length" value= ao.@length />
			    </#if>  
			    <#if ao.@precision[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="precision" value= ao.@precision />
			    </#if>  
			    <#if ao.@scale[0]??>
			      <@pp.set hash=project.entities[i].attributeOverrides[i1].column key="scale" value= ao.@scale />
			    </#if>
			  <#assign i1 = i1 + 1>
			</#list>
		</#if>	    
			    
		<#--处理table元素-->	    
		<#if e.table[0]??>
			<@pp.set hash=project.entities[i] key="table" value= pp.newWritableHash() />
			  <#if e.table.@name[0]??>
			    <@pp.set hash=project.entities[i].table key="name" value= e.table.@name />
			  </#if>
			  <#if e.table.@catalog[0]??>
			    <@pp.set hash=project.entities[i].table key="catalog" value= e.table.@catalog />
			  </#if> 
			  <#if e.table.@schema[0]??>
			    <@pp.set hash=project.entities[i].table key="schema" value= e.table.@schema />
			  </#if>
			  
			  <#if e.table.uniqueConstraint[0]??>
					<@pp.set hash=project.entities[i].table key="uniqueConstraints" value=pp.newWritableSequence()/>
					<#assign i2 = 0>
					<#list e.table.uniqueConstraint as tuc>
						<#if tuc.@columnNames[0]??>
			  			<@pp.add seq=project.entities[i].table.uniqueConstraints index=i2 value= tuc.@columnNames />
						</#if>
					  <#assign i2 = i2 + 1>
					</#list>
				</#if>
		</#if>
					
		
		<#--处理secondaryTable元素-->	
	  <#if e.secondaryTable[0]??>
			<@pp.set hash=project.entities[i] key="secondaryTables" value=pp.newWritableSequence()/>
			
			<#assign i3 = 0>
			<#list e.secondaryTable as st>
			  <#-- -->
			  <@pp.add seq=project.entities[i].secondaryTables index=i3 value=pp.newWritableHash() />
			    <#--处理secondaryTable元素中的属性 -->
			    <#if st.@name[0]??>
			      <@pp.set hash=project.entities[i].secondaryTables[i3] key="name" value= st.@name />
			    </#if>
			    <#if st.@catalog[0]??>
			      <@pp.set hash=project.entities[i].secondaryTables[i3] key="catalog" value= st.@catalog />
			    </#if>
			    <#if st.@schema[0]??>
			      <@pp.set hash=project.entities[i].secondaryTables[i3] key="schema" value= st.@schema />
			    </#if>
			    
			    <#--处理secondaryTable中的primaryKeyJoinColumn元素-->	
				  <#if st.primaryKeyJoinColumn[0]??>
						<@pp.set hash=project.entities[i].secondaryTables[i3] key="pkJoinColumns" value=pp.newWritableSequence()/>
						
						<#assign i4 = 0>
						<#list st.primaryKeyJoinColumn as pk>
						  <#-- -->
						  <@pp.add seq=project.entities[i].secondaryTables[i3].pkJoinColumns index=i4 value=pp.newWritableHash() />
						    <#--处理primaryKeyJoinColumn元素中的属性 -->
						    <#if pk.@name[0]??>
						      <@pp.set hash=project.entities[i].secondaryTables[i3].pkJoinColumns[i4] key="name" value= pk.@name />
						    </#if>
						    <#if pk.@referencedColumnName[0]??>
						      <@pp.set hash=project.entities[i].secondaryTables[i3].pkJoinColumns[i4] key="referencedColumnName" value= pk.@referencedColumnName />
						    </#if>
						    <#if pk.@columnDefinition[0]??>
						      <@pp.set hash=project.entities[i].secondaryTables[i3].pkJoinColumns[i4] key="columnDefinition" value= pk.@columnDefinition />
						    </#if>				    
						  <#assign i4 = i4 + 1>
						</#list>
					</#if>
			  
			    <#--处理secondaryTable中的uniqueConstraint元素-->	
				  <#if st.uniqueConstraint[0]??>
						<@pp.set hash=project.entities[i].secondaryTables[i3] key="uniqueConstraints" value=pp.newWritableSequence()/>
						<#assign i5 = 0>
						<#list st.uniqueConstraint as tuc>
							<#if tuc.@columnNames[0]??>
				  			<@pp.add seq=project.entities[i].secondaryTables[i3].uniqueConstraints index=i5 value= tuc.@columnNames />
							</#if>
						  <#assign i5 = i5 + 1>
						</#list>
					</#if>		
			    
			  <#assign i3 = i3 + 1>
			</#list>
		</#if>		
		
		
    <#--处理embeddedId元素中与表相关的属性-->  
		<#if e.embeddedId[0]??>
			<@pp.set hash=project.entities[i] key="embeddedId" value= pp.newWritableHash() />
			  <#if e.embeddedId.@name[0]??>
			    <@pp.set hash=project.entities[i].embeddedId key="name" value= e.embeddedId.@name />
			  </#if>
			  <#if e.embeddedId.@type[0]??>
			    <@pp.set hash=project.entities[i].embeddedId key="type" value= e.embeddedId.@type />
			  </#if> 			  
		</#if>    	
    				   
		<#--处理tableGenerator,sequenceGenerator,generator元素-->	    
		<#if e.tableGenerator[0]??>
			<@pp.set hash=project.entities[i] key="tableGenerator" value= pp.newWritableHash() />
			  <#if e.tableGenerator.@name[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="name" value= e.tableGenerator.@name />
			  </#if>
			  <#if e.tableGenerator.@table[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="table" value= e.tableGenerator.@table />
			  </#if>
			  <#if e.tableGenerator.@catalog[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="catalog" value= e.tableGenerator.@catalog />
			  </#if> 
			  <#if e.tableGenerator.@schema[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="schema" value= e.tableGenerator.@schema />
			  </#if>
			  <#if e.tableGenerator.@pkColumnName[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="pkColumnName" value= e.tableGenerator.@pkColumnName />
			  </#if> 
			  <#if e.tableGenerator.@valueColumnName[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="valueColumnName" value= e.tableGenerator.@valueColumnName />
			  </#if>
			  <#if e.tableGenerator.@pkColumnValue[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="pkColumnValue" value= e.tableGenerator.@pkColumnValue />
			  </#if>
			  <#if e.tableGenerator.@initialValue[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="initialValue" value= e.tableGenerator.@initialValue />
			  </#if> 
			  <#if e.tableGenerator.@allocationSize[0]??>
			    <@pp.set hash=project.entities[i].tableGenerator key="allocationSize" value= e.tableGenerator.@allocationSize />
			  </#if>
			  
			  
			  
			  <#if e.tableGenerator.uniqueConstraint[0]??>
					<@pp.set hash=project.entities[i].tableGenerator key="uniqueConstraints" value=pp.newWritableSequence()/>
					<#assign i6 = 0>
					<#list e.tableGenerator.uniqueConstraint as tuc>
						<#if tuc.@columnNames[0]??>
			  			<@pp.add seq=project.entities[i].tableGenerator.uniqueConstraints index=i6 value= tuc.@columnNames />
						</#if>
					  <#assign i6 = i6 + 1>
					</#list>
				</#if>
		</#if>
    <#--处理sequenceGenerator元素中与表相关的属性-->  
		<#if e.sequenceGenerator[0]??>
				<@pp.set hash=project.entities[i] key="sequenceGenerator" value= pp.newWritableHash() />
			  <#if e.sequenceGenerator.@name[0]??>
			    <@pp.set hash=project.entities[i].sequenceGenerator key="name" value= e.sequenceGenerator.@name />
			  </#if>
			  <#if e.sequenceGenerator.@sequenceName[0]??>
			    <@pp.set hash=project.entities[i].sequenceGenerator key="sequenceName" value= e.sequenceGenerator.@sequenceName />
			  </#if>	
			  <#if e.sequenceGenerator.@initialValue[0]??>
			    <@pp.set hash=project.entities[i].sequenceGenerator key="initialValue" value= e.sequenceGenerator.@initialValue />
			  </#if>
			  <#if e.sequenceGenerator.@allocationSize[0]??>
			    <@pp.set hash=project.entities[i].sequenceGenerator key="allocationSize" value= e.sequenceGenerator.@allocationSize />
			  </#if> 
		</#if>
    <#--处理hibernateGenerator元素中与表相关的属性-->  
		<#if e.hibernateGenerator[0]??>
				<@pp.set hash=project.entities[i] key="hibernateGenerator" value= pp.newWritableHash() />
			  <#if e.hibernateGenerator.@name[0]??>
			    <@pp.set hash=project.entities[i].hibernateGenerator key="name" value= e.hibernateGenerator.@name />
			  </#if>
			  <#if e.hibernateGenerator.@strategy[0]??>
			    <@pp.set hash=project.entities[i].hibernateGenerator key="strategy" value= e.hibernateGenerator.@strategy />
			  </#if>
			  
			  <#--处理hibernateGenerator元素中parameter子元素-->
		    <#if e.hibernateGenerator.parameter[0]??>
					<@pp.set hash=project.entities[i].hibernateGenerator key="parameters" value=pp.newWritableSequence()/>
					
					<#assign i7 = 0>
					<#list e.hibernateGenerator.parameter as param>
					  <#-- -->
					  <@pp.add seq=project.entities[i].hibernateGenerator.parameters index=i7 value=pp.newWritableHash() />
					    <#--处理entity元素中的属性 -->
					    <#if param.@name[0]??>
					      <@pp.set hash=project.entities[i].hibernateGenerator.parameters[i7] key="name" value= param.@name />
					    </#if>
					    <#if param.@value[0]??>
					      <@pp.set hash=project.entities[i].hibernateGenerator.parameters[i7] key="value" value= param.@value />
					    </#if>  
					  <#assign i7 = i7 + 1>
					</#list>
				</#if>		
		</#if>      	
   
    <#--处理generatedValue元素中与表相关的属性-->  
		<#if e.generatedValue[0]??>
				<@pp.set hash=project.entities[i] key="generatedValue" value= pp.newWritableHash() />
			  <#if e.generatedValue.@strategy[0]??>
			    <@pp.set hash=project.entities[i].generatedValue key="strategy" value= e.generatedValue.@strategy />
			  </#if>
			  <#if e.generatedValue.@generator[0]??>
			    <@pp.set hash=project.entities[i].generatedValue key="generator" value= e.generatedValue.@generator />
			  </#if>	
		</#if> 						
							
    <#--处理id子元素-->
    <#if e.id[0]??>
			<@pp.set hash=project.entities[i] key="ids" value=pp.newWritableSequence()/>
			
			<#assign i8 = 0>
			<#list e.id as id>
			  <#-- -->
			  <@pp.add seq=project.entities[i].ids index=i8 value=pp.newWritableHash() />
			    <#--处理entity元素中的属性 -->
			    <#if id.@name[0]??>
			      <@pp.set hash=project.entities[i].ids[i8] key="name" value= id.@name />
			    </#if>
			    <#if id.@type[0]??>
			      <@pp.set hash=project.entities[i].ids[i8] key="type" value= id.@type />
			    </#if>  
			  <@pp.set hash=project.entities[i].ids[i8]  key="column" value=pp.newWritableHash() />
			    <#if id.@columnName[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="name" value= id.@columnName />
			    </#if>
			    <#if id.@unique[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="unique" value= id.@unique />
			    </#if>  
			
			    <#if id.@nullable[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="nullable" value= id.@nullable />
			    </#if>
			    <#if id.@insertable[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="insertable" value= id.@insertable />
			    </#if>  
			
			    <#if id.@updatable[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="updatable" value= id.@updatable />
			    </#if>
			    <#if id.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="columnDefinition" value= id.@columnDefinition />
			    </#if>  
			
			    <#if id.@table[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="table" value= id.@table />
			    </#if>
			    <#if id.@length[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="length" value= id.@length />
			    </#if>  
			    <#if id.@precision[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="precision" value= id.@precision />
			    </#if>
			    <#if id.@scale[0]??>
			      <@pp.set hash=project.entities[i].ids[i8].column key="scale" value= id.@scale />
			    </#if>  
			
							<#--处理tableGenerator,sequenceGenerator,generator元素-->	    
					<#if id.tableGenerator[0]??>
						<@pp.set hash=project.entities[i].ids[i8] key="tableGenerator" value= pp.newWritableHash() />
						  <#if id.tableGenerator.@name[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="name" value= id.tableGenerator.@name />
						  </#if>
						  <#if id.tableGenerator.@table[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="table" value= id.tableGenerator.@table />
						  </#if>
						  <#if id.tableGenerator.@catalog[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="catalog" value= id.tableGenerator.@catalog />
						  </#if> 
						  <#if id.tableGenerator.@schema[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="schema" value= id.tableGenerator.@schema />
						  </#if>
						  <#if id.tableGenerator.@pkColumnName[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="pkColumnName" value= id.tableGenerator.@pkColumnName />
						  </#if> 
						  <#if id.tableGenerator.@valueColumnName[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="valueColumnName" value= id.tableGenerator.@valueColumnName />
						  </#if>
						  <#if id.tableGenerator.@pkColumnValue[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="pkColumnValue" value= id.tableGenerator.@pkColumnValue />
						  </#if>
						  <#if id.tableGenerator.@initialValue[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="initialValue" value= id.tableGenerator.@initialValue />
						  </#if> 
						  <#if id.tableGenerator.@allocationSize[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].tableGenerator key="allocationSize" value= id.tableGenerator.@allocationSize />
						  </#if>
						  
						  
						  
						  <#if id.tableGenerator.uniqueConstraint[0]??>
								<@pp.set hash=project.entities[i].ids[i8].tableGenerator key="uniqueConstraints" value=pp.newWritableSequence()/>
								<#assign i9 = 0>
								<#list id.tableGenerator.uniqueConstraint as tuc>
									<#if tuc.@columnNames[0]??>
						  			<@pp.add seq=project.entities[i].ids[i8].tableGenerator.uniqueConstraints index=i9 value= tuc.@columnNames />
									</#if>
								  <#assign i9 = i9 + 1>
								</#list>
							</#if>
					</#if>
			    <#--处理sequenceGenerator元素中与表相关的属性-->  
					<#if id.sequenceGenerator[0]??>
							<@pp.set hash=project.entities[i].ids[i8] key="sequenceGenerator" value= pp.newWritableHash() />
						  <#if id.sequenceGenerator.@name[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].sequenceGenerator key="name" value= id.sequenceGenerator.@name />
						  </#if>
						  <#if id.sequenceGenerator.@sequenceName[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].sequenceGenerator key="sequenceName" value= id.sequenceGenerator.@sequenceName />
						  </#if>	
						  <#if id.sequenceGenerator.@initialValue[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].sequenceGenerator key="initialValue" value= id.sequenceGenerator.@initialValue />
						  </#if>
						  <#if id.sequenceGenerator.@allocationSize[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].sequenceGenerator key="allocationSize" value= id.sequenceGenerator.@allocationSize />
						  </#if> 
					</#if>
			    <#--处理hibernateGenerator元素中与表相关的属性-->  
					<#if id.hibernateGenerator[0]??>
							<@pp.set hash=project.entities[i].ids[i8] key="hibernateGenerator" value= pp.newWritableHash() />
						  <#if id.hibernateGenerator.@name[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].hibernateGenerator key="name" value= id.hibernateGenerator.@name />
						  </#if>
						  <#if id.hibernateGenerator.@strategy[0]??>
						    <@pp.set hash=project.entities[i].ids[i8].hibernateGenerator key="strategy" value= id.hibernateGenerator.@strategy />
						  </#if>
						  
						  <#--处理hibernateGenerator元素中parameter子元素-->
					    <#if id.hibernateGenerator.parameter[0]??>
								<@pp.set hash=project.entities[i].ids[i8].hibernateGenerator key="parameters" value=pp.newWritableSequence()/>
								
								<#assign i10 = 0>
								<#list id.hibernateGenerator.parameter as param>
								  <#-- -->
								  <@pp.add seq=project.entities[i].ids[i8].hibernateGenerator.parameters index=i10 value=pp.newWritableHash() />
								    <#--处理entity元素中的属性 -->
								    <#if param.@name[0]??>
								      <@pp.set hash=project.entities[i].ids[i8].hibernateGenerator.parameters[i10] key="name" value= param.@name />
								    </#if>
								    <#if param.@value[0]??>
								      <@pp.set hash=project.entities[i].ids[i8].hibernateGenerator.parameters[i10] key="value" value= param.@value />
								    </#if>  
								  <#assign i10 = i10 + 1>
								</#list>
							</#if>		
					</#if>  
			  <#assign i8 = i8 + 1>
			</#list>
		</#if>			
		
							
    <#--处理field-->
    <#if e.field[0]??>
			<@pp.set hash=project.entities[i] key="fields" value=pp.newWritableSequence()/>
			
			<#assign i11 = 0>
			<#list e.field as f>
			  <#-- -->
			  <@pp.add seq=project.entities[i].fields index=i11 value=pp.newWritableHash() />
			    <#--处理entity元素中的属性 -->
			    <#if f.@name[0]??>
			      <@pp.set hash=project.entities[i].fields[i11] key="name" value= f.@name />
			    </#if>
			    <#if f.@transient[0]??>
			      <@pp.set hash=project.entities[i].fields[i11] key="transient" value= f.@transient />
			    </#if>  
			    <#if f.@type[0]??>
			      <@pp.set hash=project.entities[i].fields[i11] key="type" value= f.@type />
			    </#if>  
			  <@pp.set hash=project.entities[i].fields[i11] key="column" value=pp.newWritableHash() />
			    <#if f.@columnName[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="name" value= f.@columnName />
			    </#if>
			    <#if f.@unique[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="unique" value= f.@unique />
			    </#if>  
			
			    <#if f.@nullable[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="nullable" value= f.@nullable />
			    </#if>
			    <#if f.@insertable[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="insertable" value= f.@insertable />
			    </#if>  
			
			    <#if f.@updatable[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="updatable" value= f.@updatable />
			    </#if>
			    <#if f.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="columnDefinition" value= f.@columnDefinition />
			    </#if>  
			
			    <#if f.@table[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="table" value= f.@table />
			    </#if>
			    <#if f.@length[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="length" value= f.@length />
			    </#if>  
			    <#if f.@precision[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="precision" value= f.@precision />
			    </#if>
			    <#if f.@scale[0]??>
			      <@pp.set hash=project.entities[i].fields[i11].column key="scale" value= f.@scale />
			    </#if>  
			    
			    
			    <#if f.basic[0]??>
			  		<@pp.set hash=project.entities[i].fields[i11]  key="basic" value=pp.newWritableHash() />
				    <#if f.basic.@fetch[0]??>
				      <@pp.set hash=project.entities[i].fields[i11].basic key="fetch" value= f.basic.@fetch />
				    </#if>  
				    <#if f.basic.@optional[0]??>
				      <@pp.set hash=project.entities[i].fields[i11].basic key="optional" value= f.basic.@optional />
				    </#if>  
			    </#if>  
			    <#if f.temporal[0]??>
			    	<#if f.temporal.@value[0]??>
				      <@pp.set hash=project.entities[i].fields[i11] key="temporal" value= f.temporal.@value />
				    </#if>  
			    </#if>  
			    <#if f.enumerated[0]??>
			    	<#if f.enumerated.@value[0]??>
				      <@pp.set hash=project.entities[i].fields[i11] key="enumerated" value= f.enumerated.@value />
				    </#if>  
			    </#if>
			
			    <#if f.lob[0]??>
				      <@pp.set hash=project.entities[i].fields[i11] key="lob" value= f.lob />
			    </#if>
			    <#if f.version[0]??>
				      <@pp.set hash=project.entities[i].fields[i11] key="version" value= f.version />
			    </#if>
					
			  <#assign i11 = i11 + 1>
			</#list>
		</#if>		
		    <#--处理entity元素中attributeOverride子元素-->
    <#if e.embedded[0]??>
			<@pp.set hash=project.entities[i] key="embeddedFields" value=pp.newWritableSequence()/>
			
			<#assign i12 = 0>
			<#list e.embedded as em>
			  <#-- -->
			  <@pp.add seq=project.entities[i].embeddedFields index=i12 value=pp.newWritableHash() />
			    <#--处理entity元素中的属性 -->
			    <#if em.@name[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12] key="name" value= em.@name />
			    </#if>
			    <#if em.@type[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12] key="type" value= em.@type />
			    </#if>  
			    <#--处理attributeOverride子元素-->
			    <#if em.attributeOverride[0]??>
						<@pp.set hash=project.entities[i].embeddedFields[i12] key="attributeOverrides" value=pp.newWritableSequence()/>
						
						<#assign i13 = 0>
						<#list em.attributeOverride as ao>
						  <#-- -->
						  <@pp.add seq=project.entities[i].embeddedFields[i12].attributeOverrides index=i13 value=pp.newWritableHash() />
						    <#--处理entity元素中的属性 -->
						    <#if ao.@name[0]??>
						      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13] key="name" value= ao.@name />
						    </#if>
			  <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13]  key="column" value=pp.newWritableHash() />
			    
			    <#if ao.@columnName[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="name" value= ao.@columnName />
			    </#if>
			    <#if ao.@unique[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="unique" value= ao.@unique />
			    </#if>  
			
			    <#if ao.@nullable[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="nullable" value= ao.@nullable />
			    </#if>
			    <#if ao.@insertable[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="insertable" value= ao.@insertable />
			    </#if>  
			
			    <#if ao.@updatable[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="updatable" value= ao.@updatable />
			    </#if>
			    <#if ao.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="columnDefinition" value= ao.@columnDefinition />
			    </#if>  
			
			    <#if ao.@table[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="table" value= ao.@table />
			    </#if>
			    <#if ao.@length[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="length" value= ao.@length />
			    </#if>  
			    <#if ao.@precision[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="precision" value= ao.@precision />
			    </#if>
			    <#if ao.@scale[0]??>
			      <@pp.set hash=project.entities[i].embeddedFields[i12].attributeOverrides[i13].column key="scale" value= ao.@scale />
			    </#if>  
						  <#assign i13 = i13 + 1>
						</#list>
					</#if>	
			  <#assign i12 = i12 + 1>
			</#list>
		</#if>	
		
    <#--处理entity元素中attributeOverride子元素-->
    <#if e.collection[0]??>
			<@pp.set hash=project.entities[i] key="collectionFields" value=pp.newWritableSequence()/>
			
			<#assign i14 = 0>
			<#list e.collection as f>
			  <#-- -->
			  <@pp.add seq=project.entities[i].collectionFields index=i14 value=pp.newWritableHash() />
			    <#--处理entity元素中的属性 -->
			
			    <#if f.@name[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14] key="name" value= f.@name />
			    </#if>
			    <#if f.@type[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14] key="type" value= f.@type />
			    </#if>  
			  <@pp.set hash=project.entities[i].collectionFields[i14]  key="column" value=pp.newWritableHash() />
			    
			    <#if f.@columnName[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="name" value= f.@columnName />
			    </#if>
			    <#if f.@unique[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="unique" value= f.@unique />
			    </#if>  
			
			    <#if f.@nullable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="nullable" value= f.@nullable />
			    </#if>
			    <#if f.@insertable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="insertable" value= f.@insertable />
			    </#if>  
			
			    <#if f.@updatable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="updatable" value= f.@updatable />
			    </#if>
			    <#if f.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="columnDefinition" value= f.@columnDefinition />
			    </#if>  
			
			    <#if f.@table[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="table" value= f.@table />
			    </#if>
			    <#if f.@length[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="length" value= f.@length />
			    </#if>  
			    <#if f.@precision[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="precision" value= f.@precision />
			    </#if>
			    <#if f.@scale[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].column key="scale" value= f.@scale />
			    </#if>  
			    
			    
			    <#if f.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].collectionFields[i14] key="joinTable" value=pp.newWritableHash() />
			    	    <#--处理joinColumn子元素-->
							    <#if f.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="name" value= f.joinTable.@name />
							    </#if>
							    <#if f.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="catalog" value= f.joinTable.@catalog />
							    </#if>  
							    <#if f.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="unique" value= f.joinTable.@schema />
							    </#if>			    	    	
			    	    	
				    <#if f.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i15 = 0>
							<#list f.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].collectionFields[i14].joinTable.joinColumns index=i15 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.joinColumns[i15] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i15 = i15 + 1>
							</#list>
						</#if>
						
						    <#--处理joinColumn子元素-->
				    <#if f.joinTable.inverseJoinColumn[0]??>
							<@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="inverseJoinColumns" value=pp.newWritableSequence()/>
							
							<#assign i16 = 0>
							<#list f.joinTable.inverseJoinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns index=i16 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].collectionFields[i14].joinTable.inverseJoinColumns[i16] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i16 = i16 + 1>
							</#list>
						</#if>
						
						
					  <#if f.joinTable.uniqueConstraint[0]??>
							<@pp.set hash=project.entities[i].collectionFields[i14].joinTable key="uniqueConstraints" value=pp.newWritableSequence()/>
							<#assign i17 = 0>
							<#list f.joinTable.uniqueConstraint as tuc>
								<#if tuc.@columnNames[0]??>
					  			<@pp.add seq=project.entities[i].collectionFields[i14].joinTable.uniqueConstraints index=i17 value= tuc.@columnNames />
								</#if>
							  <#assign i17 = i17 + 1>
							</#list>
						</#if>	
			    </#if>
			    
			        <#--处理entity元素中attributeOverride子元素-->
			    <#if f.attributeOverride[0]??>
						<@pp.set hash=project.entities[i].collectionFields[i14] key="attributeOverrides" value=pp.newWritableSequence()/>
						
						<#assign i18 = 0>
						<#list f.attributeOverride as ao>
						  <#-- -->
						  <@pp.add seq=project.entities[i].collectionFields[i14].attributeOverrides index=i18 value=pp.newWritableHash() />
						    <#--处理entity元素中的属性 -->
						    <#if ao.@name[0]??>
						      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18] key="name" value= ao.@name />
						    </#if>
			  <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18]  key="column" value=pp.newWritableHash() />
			    
			    <#if f.@columnName[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="name" value= f.@columnName />
			    </#if>
			    <#if f.@unique[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="unique" value= f.@unique />
			    </#if>  
			
			    <#if f.@nullable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="nullable" value= f.@nullable />
			    </#if>
			    <#if f.@insertable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="insertable" value= f.@insertable />
			    </#if>  
			
			    <#if f.@updatable[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="updatable" value= f.@updatable />
			    </#if>
			    <#if f.@columnDefinition[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="columnDefinition" value= f.@columnDefinition />
			    </#if>  
			
			    <#if f.@table[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="table" value= f.@table />
			    </#if>
			    <#if f.@length[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="length" value= f.@length />
			    </#if>  
			    <#if f.@precision[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="precision" value= f.@precision />
			    </#if>
			    <#if f.@scale[0]??>
			      <@pp.set hash=project.entities[i].collectionFields[i14].attributeOverrides[i18].column key="scale" value= f.@scale />
			    </#if>  
						
						  <#assign i18 = i18 + 1>
						</#list>
					</#if>
					 <#--处理indexColumn元素中的属性 -->
			    <#if f.indexColumn[0]??>
			  		<@pp.set hash=project.entities[i].collectionFields[i14]  key="indexColumn" value=pp.newWritableHash() />
				    <#if f.indexColumn.@name[0]??>
				      <@pp.set hash=project.entities[i].collectionFields[i14].indexColumn key="name" value= f.indexColumn.@name />
				    </#if>  
				    <#if f.indexColumn.@base[0]??>
				      <@pp.set hash=project.entities[i].collectionFields[i14].indexColumn key="base" value= f.indexColumn.@base />
				    </#if>  
			    </#if> 
					
				  <#if f.key[0]??>
				    <@pp.set hash=project.entities[i].collectionFields[i14] key="key" value= f.key.@name />
				  </#if>  
					
							
			  <#assign i14 = i14 + 1>
			</#list>
		</#if>	   
		
		<#list doc.project.onetoone as oto>
			<#if ((oto.one[0].@entity[0] == e.@className[0]) || (oto.one[1].@entity[0] == e.@className[0]))>
					<@pp.set hash=project.entities[i] key="onetoones" value=pp.newWritableSequence()/>
					<#break>
			</#if>
		</#list>					
		
		<#--处理onetoone子元素-->
		<#assign i19 = 0>
		<#list doc.project.onetoone as oto>
			<#if (oto.one[0].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#--处理entity元素中attributeOverride子元素-->
					  <@pp.add seq=project.entities[i].onetoones index=i19 value=pp.newWritableHash() />
					  	
					    <@pp.set hash=project.entities[i].onetoones[i19] key="master" value= true />
					    <@pp.set hash=project.entities[i].onetoones[i19] key="entity" value= oto.one[1].@entity />
					    <#if oto.one[0].@name[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="name" value= oto.one[0].@name />
					    </#if>
					    <#if oto.one[0].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="targetEntity" value= oto.one[0].@targetEntity />
					    </#if> 
					    <#if oto.one[0].@cascade[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="cascade" value= oto.one[0].@cascade />
					    </#if>  
					    <#if oto.one[0].@fetch[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="fetch" value= oto.one[0].@fetch />
					    </#if>  
					    <#if oto.one[0].@optional[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="optional" value= oto.one[0].@optional />
					    </#if>  
					    <#if oto.one[0].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="mappedBy" value= oto.one[0].@mappedBy />
					    </#if>   
					    
					        <#--处理entity中primaryKeyJoinColumn子元素及其属性 -->
					    <#if oto.primaryKeyJoinColumn[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="primaryKeyJoinColumn" value= pp.newWritableHash() />
					      
					      <#if oto.primaryKeyJoinColumn.@name[0]??>
					        <@pp.set hash=project.entities[i].onetoones[i19].primaryKeyJoinColumn key="name" value= oto.primaryKeyJoinColumn.@name />  
					      </#if>  
					      <#if oto.primaryKeyJoinColumn.@referencedColumnName[0]??>
					        <@pp.set hash=project.entities[i].onetoones[i19].primaryKeyJoinColumn key="referencedColumnName" value= oto.primaryKeyJoinColumn.@referencedColumnName />  
					      </#if>  
					      <#if oto.primaryKeyJoinColumn.@columnDefinition[0]??>
					        <@pp.set hash=project.entities[i].onetoones[i19].primaryKeyJoinColumn key="columnDefinition" value= oto.primaryKeyJoinColumn.@columnDefinition />  
					      </#if> 
					    </#if> 
					
					 <#--处理joinColumn元素中的属性 -->
						 <#if oto.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetoones[i19] key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i22 = 0>
							<#list oto.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetoones[i19].joinColumns index=i22 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinColumns[i22] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i22 = i22 + 1>
							</#list>
						</#if>
					
					    
					<#--处理joinTable子元素-->    
			    <#if oto.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].onetoones[i19] key="joinTable" value=pp.newWritableHash() />
			    	    <#--处理joinColumn子元素-->
							    <#if oto.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable key="name" value=oto.joinTable.@name />
							    </#if>
							    <#if oto.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable key="catalog" value=oto.joinTable.@catalog />
							    </#if>  
							    <#if oto.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable key="unique" value=oto.joinTable.@schema />
							    </#if>		
				    <#if oto.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetoones[i19].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i23 = 0>
							<#list oto.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetoones[i19].joinTable.joinColumns index=i23 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetoones[i19].joinTable.joinColumns[i23] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i23 = i23 + 1>
							</#list>
						</#if>
						
				</#if>	    
					    
				<#assign i19 = i19 + 1>	
			<#elseif (oto.one[1].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#--该实体为被控端-->
				<#if ((oto.@type[0]??) && (oto.@type[0]?lower_case == "2"))>
					  <@pp.add seq=project.entities[i].onetoones index=i19 value=pp.newWritableHash() />
					    <@pp.set hash=project.entities[i].onetoones[i19] key="master" value= false />
					    <@pp.set hash=project.entities[i].onetoones[i19] key="entity" value= oto.one[0].@entity />
					    <#if oto.one[1].@name[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="name" value= oto.one[1].@name />
					    </#if>
					    <#if oto.one[1].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="targetEntity" value= oto.one[1].@targetEntity />
					    </#if> 
					    <#if oto.one[1].@cascade[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="cascade" value= oto.one[1].@cascade />
					    </#if>  
					    <#if oto.one[1].@fetch[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="fetch" value= oto.one[1].@fetch />
					    </#if>  
					    <#if oto.one[1].@optional[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="optional" value= oto.one[1].@optional />
					    </#if>  
					    <#if oto.one[1].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].onetoones[i19] key="mappedBy" value= oto.one[1].@mappedBy />
					    <#else>
					    	  <@pp.set hash=project.entities[i].onetoones[i19] key="mappedBy" value= oto.one[0].@name!(oto.one[0].entity) />
					    </#if>   
				<#assign i19 = i19 + 1>	
				</#if>			
			</#if>	 
			
		</#list>     	


   		
		<#--处理onetomany子元素-->
		<#list doc.project.onetomany as otm>
			<#if ((otm.one[0].@entity[0] == e.@className[0]) || (otm.many[0].@entity[0] == e.@className[0]))>
					<@pp.set hash=project.entities[i] key="onetomanys" value=pp.newWritableSequence()/>
					<#break>
			</#if>
		</#list>					
		
		<#--处理onetomany子元素-->
		<#assign i20 = 0>
		<#list doc.project.onetomany as otm>
			<#if (otm.one[0].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#if ((otm.@type[0]??) && (otm.@type[0]?lower_case == "2"))>
				<#--处理entity元素中attributeOverride子元素-->
					  <@pp.add seq=project.entities[i].onetomanys index=i20 value=pp.newWritableHash() />
					  	
					    <@pp.set hash=project.entities[i].onetomanys[i20] key="entity" value= otm.many[0].@entity />
					    <@pp.set hash=project.entities[i].onetoones[i20] key="one" value= true />
					    <#if otm.one[0].@name[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="name" value= otm.one[0].@name />
					    </#if>
					    <#if otm.one[0].@collectionType[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="collectionType" value= otm.one[0].@collectionType />
					    </#if>
					    <#if otm.one[0].@orderBy[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="orderBy" value= otm.one[0].@orderBy />
					    </#if>
					    <#if otm.one[0].@mapkey[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="mapkey" value= otm.one[0].@mapkey />
					    </#if>
					    <#if otm.one[0].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="targetEntity" value= otm.one[0].@targetEntity />
					    </#if> 
					    <#if otm.one[0].@cascade[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="cascade" value= otm.one[0].@cascade />
					    </#if>  
					    <#if otm.one[0].@fetch[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="fetch" value= otm.one[0].@fetch />
					    </#if>  
					    <#if otm.one[0].@optional[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="optional" value= otm.one[0].@optional />
					    </#if>  
					    
					    <#if ((otm.one[0].@master[0]??) && (otm.one[0].@master[0] == "true"))>
					    	<@pp.set hash=project.entities[i].onetomanys[i20] key="master" value= true />
					    	
					 <#--处理joinColumn元素中的属性 -->
						 <#if otm.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20] key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i24 = 0>
							<#list otm.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinColumns index=i24 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i24] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i24 = i24 + 1>
							</#list>
						</#if>
					
					    
					<#--处理joinTable子元素-->    
			    <#if otm.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].onetomanys[i20] key="joinTable" value=pp.newWritableHash() />
							    <#if otm.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="name" value=otm.joinTable.@name />
							    </#if>
							    <#if otm.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="catalog" value=otm.joinTable.@catalog />
							    </#if>  
							    <#if otm.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="unique" value=otm.joinTable.@schema />
							    </#if>		
			    	
			    	    <#--处理joinColumn子元素-->
				    <#if otm.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i25 = 0>
							<#list otm.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinTable.joinColumns index=i25 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i25] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i25 = i25 + 1>
							</#list>
						</#if>
						
				</#if>	    
					    	
					    	
					    <#else>
						    <#if otm.one[0].@mappedBy[0]??>
						      <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.one[0].@mappedBy />
						    <#else>
						    	 <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.many[0].@entity />
						    </#if>  
					    </#if>
				<#assign i20 = i20 + 1>	
					</#if>
				<#if ((otm.@type[0]??) && (otm.@type[0]?lower_case == "1"))> 
					  	<#if ((otm.one[0].@master[0]??) && (otm.one[0].@master[0] == "true")) >
							  <@pp.add seq=project.entities[i].onetomanys index=i20 value=pp.newWritableHash() />
							  	<#if otm.one[0].@master[0]??>
							    	<@pp.set hash=project.entities[i].onetomanys[i20] key="master" value= true  />
							    </#if>
							    <@pp.set hash=project.entities[i].onetomanys[i20] key="entity" value= otm.many[0].@entity />
					    <@pp.set hash=project.entities[i].onetoones[i20] key="one" value=true />
							    <#if otm.one[0].@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="name" value= otm.one[0].@name />
							    </#if>
							    <#if otm.one[0].@collectionType[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="collectionType" value= otm.one[0].@collectionType />
							    </#if>
							    <#if otm.one[0].@orderBy[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="orderBy" value= otm.one[0].@orderBy />
							    </#if>
							    <#if otm.one[0].@mapkey[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="mapkey" value= otm.one[0].@mapkey />
							    </#if>
							    <#if otm.one[0].@targetEntity[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="targetEntity" value= otm.one[0].@targetEntity />
							    </#if> 
							    <#if otm.one[0].@cascade[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="cascade" value= otm.one[0].@cascade />
							    </#if>  
							    <#if otm.one[0].@fetch[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="fetch" value= otm.one[0].@fetch />
							    </#if>  
							    <#if otm.one[0].@optional[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="optional" value= otm.one[0].@optional />
							    </#if>  
							    <#if otm.one[0].@mappedBy[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.one[0].@mappedBy />
							    </#if>   
							    					    	
					 <#--处理joinColumn元素中的属性 -->
						 <#if otm.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20] key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i26 = 0>
							<#list otm.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinColumns index=i26 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i26] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i26 = i26 + 1>
							</#list>
						</#if>
					
					    
					<#--处理joinTable子元素-->    
			    <#if otm.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].onetomanys[i20] key="joinTable" value=pp.newWritableHash() />
							    <#if otm.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="name" value=otm.joinTable.@name />
							    </#if>
							    <#if otm.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="catalog" value=otm.joinTable.@catalog />
							    </#if>  
							    <#if otm.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="unique" value=otm.joinTable.@schema />
							    </#if>	

			    	    <#--处理joinColumn子元素-->
				    <#if otm.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i27 = 0>
							<#list otm.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinTable.joinColumns index=i27 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i27] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i27 = i27 + 1>
							</#list>
						</#if>
						
				</#if>	    
					    	
					    	
							    
							    
							    
				<#assign i20 = i20 + 1>	
					  	</#if>
				</#if>	  		
			<#elseif (otm.many[0].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#if ((otm.@type[0]??) && (otm.@type[0]?lower_case == "2"))>
					  <@pp.add seq=project.entities[i].onetomanys index=i20 value=pp.newWritableHash() />
					   
					    <@pp.set hash=project.entities[i].onetomanys[i20] key="entity" value= otm.many[0].@entity />
					    <@pp.set hash=project.entities[i].onetomanys[i20] key="one" value= false />
					    <#if otm.many[0].@name[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="name" value= otm.one[0].@name />
					    </#if>
					    <#if otm.many[0].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="targetEntity" value= otm.many[0].@targetEntity />
					    </#if> 
					    <#if otm.many[0].@cascade[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="cascade" value= otm.many[0].@cascade />
					    </#if>  
					    <#if otm.many[0].@fetch[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="fetch" value= otm.many[0].@fetch />
					    </#if>  
					    <#if otm.many[0].@optional[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="optional" value= otm.many[0].@optional />
					    </#if>  
					    <#if otm.many[0].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.many[0].@mappedBy />
					    <#else>
					    	  <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.one[0].@name!(otm.one[0].entity) />
					    </#if>
					    
					    
					    <#if ((otm.many[0].@master[0]??) && (otm.many[0].@master[0] == "true"))>
					    	<@pp.set hash=project.entities[i].onetomanys[i20] key="master" value= true />
					    				    	
					 <#--处理joinColumn元素中的属性 -->
						 <#if otm.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20] key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i28 = 0>
							<#list otm.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinColumns index=i28 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i28] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i28 = i28 + 1>
							</#list>
						</#if>
					
					    
					<#--处理joinTable子元素-->    
			    <#if otm.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].onetomanys[i20] key="joinTable" value=pp.newWritableHash() />
							    <#if otm.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="name" value=otm.joinTable.@name />
							    </#if>
							    <#if otm.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="catalog" value=otm.joinTable.@catalog />
							    </#if>  
							    <#if otm.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="unique" value=otm.joinTable.@schema />
							    </#if>	

			    	    <#--处理joinColumn子元素-->
				    <#if otm.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i29 = 0>
							<#list otm.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinTable.joinColumns index=i29 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i29] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i29 = i29 + 1>
							</#list>
						</#if>
						
				</#if>	    
					    	
					    	
					    <#else>
						    <#if otm.many[0].@mappedBy[0]??>
						      <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.many[0].@mappedBy />
						    <#else>
						    	 <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.one[0].@entity />
						    </#if>  
					    </#if>
				<#assign i20 = i20 + 1>	
					</#if>
				<#if ((otm.@type[0]??) && (otm.@type[0]?lower_case == "1"))> 
					  	<#if ((otm.many[0].@master[0]??) && (otm.many[0].@master[0] == "true")) >	
					  <@pp.add seq=project.entities[i].onetomanys index=i20 value=pp.newWritableHash() />
					    <#if otm.many[0].@master[0]??>
					    	<@pp.set hash=project.entities[i].onetomanys[i20] key="master" value= true />
					     </#if>
					    <@pp.set hash=project.entities[i].onetomanys[i20] key="entity" value= otm.many[0].@entity />
					    <@pp.set hash=project.entities[i].onetomanys[i20] key="one" value= false />
					    <#if otm.many[0].@name[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="name" value= otm.one[0].@name />
					    </#if>
					    <#if otm.many[0].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="targetEntity" value= otm.many[0].@targetEntity />
					    </#if> 
					    <#if otm.many[0].@cascade[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="cascade" value= otm.many[0].@cascade />
					    </#if>  
					    <#if otm.many[0].@fetch[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="fetch" value= otm.many[0].@fetch />
					    </#if>  
					    <#if otm.many[0].@optional[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="optional" value= otm.many[0].@optional />
					    </#if>  
					    <#if otm.many[0].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.many[0].@mappedBy />
					    <#else>
					    	  <@pp.set hash=project.entities[i].onetomanys[i20] key="mappedBy" value= otm.one[0].@name!(otm.one[0].entity) />
					    </#if>
					     	
					 <#--处理joinColumn元素中的属性 -->
						 <#if otm.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20] key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i30 = 0>
							<#list otm.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinColumns index=i30 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinColumns[i30] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i30 = i30 + 1>
							</#list>
						</#if>
					
					    
					<#--处理joinTable子元素-->    
			    <#if otm.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].onetomanys[i20] key="joinTable" value=pp.newWritableHash() />
							    <#if otm.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="name" value=otm.joinTable.@name />
							    </#if>
							    <#if otm.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="catalog" value=otm.joinTable.@catalog />
							    </#if>  
							    <#if otm.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="unique" value=otm.joinTable.@schema />
							    </#if>	
			    	    <#--处理joinColumn子元素-->
				    <#if otm.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].onetomanys[i20].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i31 = 0>
							<#list otm.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].onetomanys[i20].joinTable.joinColumns index=i31 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].onetomanys[i20].joinTable.joinColumns[i31] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i31 = i31 + 1>
							</#list>
						</#if>
						
				</#if>	    
					    	
					    
				<#assign i20 = i20 + 1>	
					</#if>
			</#if>	 
		</#if>	
		</#list>  
		
		
		
	   
		
		<#--处理manytomany子元素-->
		<#list doc.project.manytomany as mtm>
			<#if ((mtm.many[0].@entity[0] == e.@className[0]) || (mtm.many[1].@entity[0] == e.@className[0]))>
					<@pp.set hash=project.entities[i] key="manytomanys" value=pp.newWritableSequence()/>
					<#break>
			</#if>
		</#list>					
		
		<#assign i21 = 0>
		<#list doc.project.manytomany as mtm>
			<#if (mtm.many[0].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#--处理entity元素中attributeOverride子元素-->
					  <@pp.add seq=project.entities[i].manytomanys index=i21 value=pp.newWritableHash() />
					  	
					    <@pp.set hash=project.entities[i].manytomanys[i21] key="master" value= true />
					    <@pp.set hash=project.entities[i].manytomanys[i21] key="entity" value= mtm.many[1].@entity />
					    <#if mtm.many[0].@name[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="name" value= mtm.many[0].@name />
					    </#if>
							<#if mtm.many[0].@collectionType[0]??>
							  <@pp.set hash=project.entities[i].manytomanys[i21] key="collectionType" value= mtm.many[0].@collectionType />
							</#if>
					    <#if mtm.many[0].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="targetEntity" value= mtm.many[0].@targetEntity />
					    </#if> 
					    <#if mtm.many[0].@cascade[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="cascade" value= mtm.many[0].@cascade />
					    </#if>  
					    <#if mtm.many[0].@fetch[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="fetch" value= mtm.many[0].@fetch />
					    </#if>  
					    <#if mtm.many[0].@optional[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="optional" value= mtm.many[0].@optional />
					    </#if>  
					    <#if mtm.many[0].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="mappedBy" value= mtm.many[0].@mappedBy />
					    </#if>   
					    
					    
					<#--处理joinTable子元素-->    
			    <#if mtm.joinTable[0]??>
			  		<@pp.set hash=project.entities[i].manytomanys[i21] key="joinTable" value=pp.newWritableHash() />
							    <#if mtm.joinTable.@name[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable key="name" value= mtm.joinTable.@name />
							    </#if>
							    <#if mtm.joinTable.@catalog[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable key="catalog" value= mtm.joinTable.@catalog />
							    </#if>  
							    <#if mtm.joinTable.@schema[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable key="unique" value= mtm.joinTable.@schema />
							    </#if>	
			    	    <#--处理joinColumn子元素-->
				    <#if mtm.joinTable.joinColumn[0]??>
							<@pp.set hash=project.entities[i].manytomanys[i21].joinTable key="joinColumns" value=pp.newWritableSequence()/>
							
							<#assign i32 = 0>
							<#list mtm.joinTable.joinColumn as jc>
							  <#-- -->
							  <@pp.add seq=project.entities[i].manytomanys[i21].joinTable.joinColumns index=i32 value=pp.newWritableHash() />
							    <#--处理entity元素中的属性 -->
							    <#if jc.@name[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="name" value= jc.@name />
							    </#if>
							    <#if jc.@referencedColumnName[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="referencedColumnName" value= jc.@referencedColumnName />
							    </#if>  
							    <#if jc.@unique[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="unique" value= jc.@unique />
							    </#if>
							    <#if jc.@nullable[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="nullable" value= jc.@nullable />
							    </#if>  
							    <#if jc.@insertable[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="insertable" value= jc.@insertable />
							    </#if>
							    <#if jc.@updatable[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="updatable" value= jc.@updatable />
							    </#if>  
							    <#if jc.@columnDefinition[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="columnDefinition" value= jc.@columnDefinition />
							    </#if>
							    <#if jc.@table[0]??>
							      <@pp.set hash=project.entities[i].manytomanys[i21].joinTable.joinColumns[i32] key="table" value= jc.@table />
							    </#if>  
							
							  <#assign i32 = i32 + 1>
							</#list>
						</#if>
						
				</#if>	    
				<#assign i21 = i21 + 1>	
			<#elseif (mtm.many[1].@entity[0]?lower_case == e.@className[0]?lower_case)>
				<#--该实体为被控端-->
				<#if ((mtm.@type[0]??) && (mtm.@type[0]?lower_case == "2"))>
					  <@pp.add seq=project.entities[i].manytomanys index=i21 value=pp.newWritableHash() />
					    <@pp.set hash=project.entities[i].manytomanys[i21] key="master" value= false />
					    <@pp.set hash=project.entities[i].manytomanys[i21] key="entity" value= mtm.many[0].@entity />
					    <#if mtm.many[1].@name[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="name" value= mtm.many[1].@name />
					    </#if>
							<#if mtm.many[1].@collectionType[0]??>
							  <@pp.set hash=project.entities[i].manytomanys[i21] key="collectionType" value= mtm.many[1].@collectionType />
							</#if>
					    <#if mtm.many[1].@targetEntity[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="targetEntity" value= mtm.many[1].@targetEntity />
					    </#if> 
					    <#if mtm.many[1].@cascade[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="cascade" value= mtm.many[1].@cascade />
					    </#if>  
					    <#if mtm.many[1].@fetch[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="fetch" value= mtm.many[1].@fetch />
					    </#if>  
					    <#if mtm.many[1].@optional[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="optional" value= mtm.many[1].@optional />
					    </#if>  
					    <#if mtm.many[1].@mappedBy[0]??>
					      <@pp.set hash=project.entities[i].manytomanys[i21] key="mappedBy" value= mtm.many[1].@mappedBy />
					    <#else>
					    	  <@pp.set hash=project.entities[i].manytomanys[i21] key="mappedBy" value= mtm.many[0].@name!(mtm.many[0].entity) />
					    </#if>   
				<#assign i21 = i21 + 1>	
				</#if>			
			</#if>	 
			
		</#list>     	
		
		   
  <#assign i = i + 1>
</#list>

<#function print var prefix>
	<#if var?is_boolean>
		<#return prefix + ":" + var?string("true", "false")>
	</#if>		
  <#if (var?trim?length > 0)>
  <#return prefix + ":" + var>
  </#if>
  <#return ""> 
</#function>
 
<#function pathUrl package>
	<#local p = package?split(".")>
	<#local retValue = "">
		<#list p as o>
			<#local retValue = retValue + "/" + o?trim>
		</#list>
	<#return retValue>	
</#function>   
project value:

<#if project??>
project:
  ${print(project.name!, "name")}
  ${print(project.basepackage!, "package")}
  ${print(project.author!, "author")}
  <#if project.entities??>
  <#list project.entities as entity>
  entity:
    ${print(entity.className!, "className")}
    ${print(entity.mappedSuperClass!, "mappedSuperClass")}
    ${print(entity.embeddable!, "embeddable")}
    ${print(entity.inheritance!, "inheritance")}
    ${print(entity.discriminatorValue!, "discriminatorValue")}
    ${print(entity.extends!, "extends")}
    ${print(entity.implements!, "implements")}
    ${print(entity.package!, "package")}
    
    <#if entity.discriminatorColumn??>
    discriminatorColumn:
      ${print(entity.discriminatorColumn.name!, "name")}
      ${print(entity.discriminatorColumn.discriminatorType!, "discriminatorType")}
      ${print(entity.discriminatorColumn.columnDefinition!, "columnDefinition")}
      ${print(entity.discriminatorColumn.length!, "length")}
        
    </#if>
    

    <#if entity.primaryKeyJoinColumn??>
    	<#list entity.primaryKeyJoinColumns as primaryKeyJoinColumn>
    	primaryKeyJoinColumn:
	      ${print(entity.primaryKeyJoinColumn.name!, "name")}
	      ${print(entity.primaryKeyJoinColumn.referencedColumnName!, "referencedColumnName")}
	      ${print(entity.primaryKeyJoinColumn.columnDefinition!, "columnDefinition")}   
    	</#list>
    </#if>	 
    
    <#if entity.attributeOverrides??>
    	<#list entity.attributeOverrides as attributeOverride>
    	attributeOverride:
    		${print(attributeOverride.name!, "name")}
    		${print(attributeOverride.columnName!, "columnName")}
    		${print(attributeOverride.unique!, "unique")}
    		${print(attributeOverride.nullable!, "nullable")}
    		${print(attributeOverride.insertable!, "insertable")}
    		${print(attributeOverride.updatable!, "updatable")}
    		${print(attributeOverride.columnDefinition!, "columnDefinition")}
    		${print(attributeOverride.table!, "table")}
    		${print(attributeOverride.length!, "length")}
    		${print(attributeOverride.precision!, "precision")}
    		${print(attributeOverride.scale!, "scale")}
    	</#list>
    </#if>	
    
    <#if entity.table??>
    table:
      ${print(entity.table.name!, "name")}
      ${print(entity.table.catalog!, "catalog")}
      ${print(entity.table.schema!, "schema")}   
	    <#if entity.table.uniqueConstraints??>
	    	<#list entity.table.uniqueConstraints as uc>
	    	uniqueConstraints:
	    		${print(uc!, "columnNames")}
	    	</#list>
	    </#if>     
    </#if>
    
    <#if entity.secondaryTables??>
    	<#list entity.secondaryTables as secondaryTable>
    	secondaryTable:
    		${print(secondaryTable.name!, "name")}
    		${print(secondaryTable.catalog!, "catalog")}
    		${print(secondaryTable.schema!, "schema")}
    		
		    <#if secondaryTable.pkJoinColumns??>
		    	<#list secondaryTable.pkJoinColumns as primaryKeyJoinColumn>
		    	primaryKeyJoinColumn:
		    		${print(primaryKeyJoinColumn.name!, "name")}
		    		${print(primaryKeyJoinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(primaryKeyJoinColumn.columnDefinition!, "columnDefinition")}
		    	</#list>
		    </#if>	 
		    <#if secondaryTable.uniqueConstraints??>
		    	<#list secondaryTable.uniqueConstraints as uc>
		    	uniqueConstraints:
		    		${print(uc!, "columnName")}
		    	</#list>
		    </#if>     
    	</#list>
    </#if>	
    
   
    ${print(entity.idClass!, "idClass")} 
    <#if entity.embeddedId??>
    embeddedId:
      ${print(entity.embeddedId.name!, "name")}
      ${print(entity.embeddedId.type!, "type")}       
    </#if>
    
    <#if entity.tableGenerator??>
    tableGenerator:
      ${print(entity.tableGenerator.name!, "name")}
      ${print(entity.tableGenerator.table!, "table")}  
      ${print(entity.tableGenerator.catalog!, "catalog")}
      ${print(entity.tableGenerator.schema!, "schema")} 
      ${print(entity.tableGenerator.pkColumnName!, "pkColumnName")}
      ${print(entity.tableGenerator.valueColumnName!, "valueColumnName")} 
      ${print(entity.tableGenerator.pkColumValue!, "pkColumValue")}
      ${print(entity.tableGenerator.initialValue!, "initialValue")} 
      ${print(entity.tableGenerator.allocationSize!, "allocationSize")}
		  <#if entity.tableGenerator.uniqueConstraints??>
		   	<#list entity.tableGenerator.uniqueConstraints as uc>
		   	uniqueConstraints:
		   		${print(uc!, "columnName")}
		   	</#list>
		  </#if>     
    </#if>
    <#if entity.sequenceGenerator??>
    sequenceGenerator:
      ${print(entity.sequenceGenerator.name!, "name")}
      ${print(entity.sequenceGenerator.sequenceName!, "sequenceName")}       
    </#if>
    <#if entity.hibernateGenerator??>
    hibernateGenerator:
      ${print(entity.hibernateGenerator.name!, "name")}
      ${print(entity.hibernateGenerator.strategy!, "strategy")}     
    
	    <#if entity.hibernateGenerator.parameters??>
	    	<#list entity.hibernateGenerator.parameters as parameter>
	    	parameter:
	    		${print(parameter.name!, "name")}
	    		${print(parameter.value!, "value")}
	    	</#list>
	    </#if>	  
    </#if>
    <#if entity.generatedValue??>
    generatedValue:
      ${print(entity.generatedValue.strategy!, "strategy")}
      ${print(entity.generatedValue.generator!, "generator")}       
    </#if>
    
    
    
    <#if entity.ids??>
    	<#list entity.ids as id>
    	id:
    		${print(id.name!, "name")}
    		${print(id.type!, "type")}
    		${print(id.columnName!, "columnName")}
    		${print(id.unique!, "unique")}
    		${print(id.nullable!, "nullable")}
    		${print(id.insertable!, "insertable")}
    		${print(id.updatable!, "updatable")}
    		${print(id.columnDefinition!, "columnDefinition")}
    		${print(id.table!, "table")}
    		${print(id.length!, "length")}
    		${print(id.precision!, "precision")}
    		${print(id.scale!, "scale")}
    		
    		<#if id.tableGenerator??>
		    tableGenerator:
		      ${print(id.tableGenerator.name!, "name")}
		      ${print(id.tableGenerator.table!, "table")}  
		      ${print(id.tableGenerator.catalog!, "catalog")}
		      ${print(id.tableGenerator.schema!, "schema")} 
		      ${print(id.tableGenerator.pkColumnName!, "pkColumnName")}
		      ${print(id.tableGenerator.valueColumnName!, "valueColumnName")} 
		      ${print(id.tableGenerator.pkColumValue!, "pkColumValue")}
		      ${print(id.tableGenerator.initialValue!, "initialValue")} 
		      ${print(id.tableGenerator.allocationSize!, "allocationSize")}
				  <#if id.tableGenerator.uniqueConstraints??>
				   	<#list id.tableGenerator.uniqueConstraints as uc>
				   	uniqueConstraints:
				   		${print(uc!, "columnName")}
				   	</#list>
				  </#if>     
		    </#if>
		    <#if id.sequenceGenerator??>
		    sequenceGenerator:
		      ${print(id.sequenceGenerator.name!, "name")}
		      ${print(id.sequenceGenerator.sequenceName!, "sequenceName")}       
		    </#if>
		    <#if id.hibernateGenerator??>
		    hibernateGenerator:
		      ${print(id.hibernateGenerator.name!, "name")}
		      ${print(id.hibernateGenerator.strategy!, "strategy")}     
		    
			    <#if id.hibernateGenerator.parameters??>
			    	<#list id.hibernateGenerator.parameters as parameter>
			    	parameter:
			    		${print(parameter.name!, "name")}
			    		${print(parameter.value!, "value")}
			    	</#list>
			    </#if>	  
		    </#if>
    	</#list>
    </#if>	
    
    
    <#if entity.fields??>
    	<#list entity.fields as field>
    	field:
    		${print(field.name!, "name")}
    		${print(field.type!, "type")}
    		${print(field.columnName!, "columnName")}
    		${print(field.unique!, "unique")}
    		${print(field.nullable!, "nullable")}
    		${print(field.insertable!, "insertable")}
    		${print(field.updatable!, "updatable")}
    		${print(field.columnDefinition!, "columnDefinition")}
    		${print(field.table!, "table")}
    		${print(field.length!, "length")}
    		${print(field.precision!, "precision")}
    		${print(field.scale!, "scale")}
    		
    		${print(field.transient!, "transient")}
		    <#if field.basic??>
		    basic:
		      ${print(field.basic.fetch!, "fetch")}
		      ${print(field.basic.optional!, "optional")}       
		    </#if>
    		
    		${print(field.temporal!, "temporal")}
    		${print(field.enumerated!, "enumerated")}
    		${print(field.lob!, "lob")}
    		${print(field.version!, "version")}
    		
    	</#list>
    </#if>	    

    
    <#if entity.embeddedFields??>
    	<#list entity.embeddedFields as embeddedField>
    	embeddedField:
    		${print(embeddedField.name!, "name")}
    		${print(embeddedField.type!, "type")}
    		    
		    <#if embeddedField.attributeOverrides??>
		    	<#list embeddedField.attributeOverrides as attributeOverride>
		    	attributeOverride:
		    		${print(attributeOverride.name!, "name")}
		    		${print(attributeOverride.columnName!, "columnName")}
		    		${print(attributeOverride.unique!, "unique")}
		    		${print(attributeOverride.nullable!, "nullable")}
		    		${print(attributeOverride.insertable!, "insertable")}
		    		${print(attributeOverride.updatable!, "updatable")}
		    		${print(attributeOverride.columnDefinition!, "columnDefinition")}
		    		${print(attributeOverride.table!, "table")}
		    		${print(attributeOverride.length!, "length")}
		    		${print(attributeOverride.precision!, "precision")}
		    		${print(attributeOverride.scale!, "scale")}
		    	</#list>
		    </#if>	
    	</#list>
    </#if>	        

    <#if entity.collectionFields??>
    	<#list entity.fields as collectionField>
    	collectionField:
    		${print(collectionField.name!, "name")}
    		${print(collectionField.type!, "type")}
    		${print(collectionField.columnName!, "columnName")}
    		${print(collectionField.unique!, "unique")}
    		${print(collectionField.nullable!, "nullable")}
    		${print(collectionField.insertable!, "insertable")}
    		${print(collectionField.updatable!, "updatable")}
    		${print(collectionField.columnDefinition!, "columnDefinition")}
    		${print(collectionField.table!, "table")}
    		${print(collectionField.length!, "length")}
    		${print(collectionField.precision!, "precision")}
    		${print(collectionField.scale!, "scale")}
    		
		    <#if entity.joinTable??>
		    joinTable:
		    <#if entity.joinTable.joinColumns??>
		    	<#list entity.joinTable.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if entity.joinTable.inverseJoinColumns??>
		    	<#list entity.joinTable.inverseJoinColumns as inverseJoinColumn>
		    	inverseJoinColumn:
		    		${print(inverseJoinColumn.name!, "name")}
		    		${print(inverseJoinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(inverseJoinColumn.unique!, "unique")}
		    		${print(inverseJoinColumn.nullable!, "nullable")}
		    		${print(inverseJoinColumn.insertable!, "insertable")}
		    		${print(inverseJoinColumn.updatable!, "updatable")}
		    		${print(inverseJoinColumn.columnDefinition!, "columnDefinition")}
		    		${print(inverseJoinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if entity.joinTable.uniqueConstraints??>
			  	<#list entity.joinTable.uniqueConstraints as uc>
			   	uniqueConstraints:
			   		${print(uc!, "columnNames")}
			   	</#list>
			  </#if>   
			</#if>    	    
		    <#if collectionField.attributeOverrides??>
		    	<#list collectionField.attributeOverrides as attributeOverride>
		    	attributeOverride:
		    		${print(attributeOverride.name!, "name")}
		    		${print(attributeOverride.columnName!, "columnName")}
		    		${print(attributeOverride.unique!, "unique")}
		    		${print(attributeOverride.nullable!, "nullable")}
		    		${print(attributeOverride.insertable!, "insertable")}
		    		${print(attributeOverride.updatable!, "updatable")}
		    		${print(attributeOverride.columnDefinition!, "columnDefinition")}
		    		${print(attributeOverride.table!, "table")}
		    		${print(attributeOverride.length!, "length")}
		    		${print(attributeOverride.precision!, "precision")}
		    		${print(attributeOverride.scale!, "scale")}
		    	</#list>
		    </#if>	
    		
		    <#if collectionField.indexColumn??>
		    indexColumn:
		      ${print(collectionField.indexColumn.name!, "name")}
		      ${print(collectionField.indexColumn.base!, "base")}       
		    </#if>
		    ${print(collectionField.key!, "key")}
    	</#list>
    </#if>	  


    
    <#if entity.onetoones??>
    	<#list entity.onetoones as onetoone>
    	onetoone:
    		${print(onetoone.master!, "master")}
    		${print(onetoone.entity!, "entity")}
    		${print(onetoone.name!, "name")}
    		${print(onetoone.targetEntity!, "targetEntity")}
    		${print(onetoone.cascade!, "cascade")}
    		${print(onetoone.fetch!, "fetch")}
    		${print(onetoone.optional!, "optional")}
    		${print(onetoone.mappedBy!, "mappedBy")}
    		
		    <#if onetoone.primaryKeyJoinColumn??>
		    primaryKeyJoinColumn:
		      ${print(onetoone.primaryKeyJoinColumn.name!, "name")}
		      ${print(onetoone.primaryKeyJoinColumn.referencedColumnName!, "referencedColumnName")}
		      ${print(onetoone.primaryKeyJoinColumn.columnDefinition!, "columnDefinition")}        
		    </#if>
		    
		    
		    <#if onetoone.joinColumns??>
		    	<#list onetoone.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetoone.joinTable??>
		    joinTable:
		      ${print(onetoone.joinTable.name!, "name")}
		      ${print(onetoone.joinTable.catalog!, "catalog")}
		      ${print(onetoone.joinTable.schema!, "schema")}   
		    <#if onetoone.joinTable.joinColumns??>
		    	<#list onetoone.joinTable.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetoone.joinTable.inverseJoinColumns??>
		    	<#list onetoone.joinTable.inverseJoinColumns as inverseJoinColumn>
		    	inverseJoinColumn:
		    		${print(inverseJoinColumn.name!, "name")}
		    		${print(inverseJoinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(inverseJoinColumn.unique!, "unique")}
		    		${print(inverseJoinColumn.nullable!, "nullable")}
		    		${print(inverseJoinColumn.insertable!, "insertable")}
		    		${print(inverseJoinColumn.updatable!, "updatable")}
		    		${print(inverseJoinColumn.columnDefinition!, "columnDefinition")}
		    		${print(inverseJoinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetoone.joinTable.uniqueConstraints??>
			  	<#list onetoone.joinTable.uniqueConstraints as uc>
			   	uniqueConstraints:
			   		${print(uc!, "columnNames")}
			   	</#list>
			  </#if>   
			</#if>    	  
    	</#list>
    </#if>		
    
    
    <#if entity.onetomanys??>
    	<#list entity.onetomanys as onetomany>
    	onetomany:
    		${print(onetomany.master!, "master")}
    		${print(onetomany.one!, "one")}
    		${print(onetomany.entity!, "entity")}
    		${print(onetomany.name!, "name")}
    		${print(onetomany.collectionType!, "collectionType")}
    		${print(onetomany.orderBy!, "orderBy")}
    		${print(onetomany.mapkey!, "mapkey")}
    		${print(onetomany.targetEntity!, "targetEntity")}
    		${print(onetomany.cascade!, "cascade")}
    		${print(onetomany.fetch!, "fetch")}
    		${print(onetomany.optional!, "optional")}
    		${print(onetomany.mappedBy!, "mappedBy")}
    		
    		
		    
		    <#if onetomany.joinColumns??>
		    	<#list onetomany.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetomany.joinTable??>
		    joinTable:
		      ${print(onetomany.joinTable.name!, "name")}
		      ${print(onetomany.joinTable.catalog!, "catalog")}
		      ${print(onetomany.joinTable.schema!, "schema")}   
		    <#if onetomany.joinTable.joinColumns??>
		    	<#list onetomany.joinTable.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetomany.joinTable.inverseJoinColumns??>
		    	<#list onetomany.joinTable.inverseJoinColumns as inverseJoinColumn>
		    	inverseJoinColumn:
		    		${print(inverseJoinColumn.name!, "name")}
		    		${print(inverseJoinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(inverseJoinColumn.unique!, "unique")}
		    		${print(inverseJoinColumn.nullable!, "nullable")}
		    		${print(inverseJoinColumn.insertable!, "insertable")}
		    		${print(inverseJoinColumn.updatable!, "updatable")}
		    		${print(inverseJoinColumn.columnDefinition!, "columnDefinition")}
		    		${print(inverseJoinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if onetomany.joinTable.uniqueConstraints??>
			  	<#list onetomany.joinTable.uniqueConstraints as uc>
			   	uniqueConstraints:
			   		${print(uc!, "columnNames")}
			   	</#list>
			  </#if>   
			</#if>    	  
			
    	</#list>
    </#if>
        
    <#if entity.manytomanys??>
    	<#list entity.manytomanys as manytomany>
    	manytomany:
    		${print(manytomany.master!, "master")}
    		${print(manytomany.entity!, "entity")}
    		${print(manytomany.name!, "name")}
    		${print(manytomany.collectionType!, "collectionType")}
    		${print(manytomany.targetEntity!, "targetEntity")}
    		${print(manytomany.cascade!, "cascade")}
    		${print(manytomany.fetch!, "fetch")}
    		${print(manytomany.optional!, "optional")}
    		${print(manytomany.mappedBy!, "mappedBy")}
    		
    		
		    <#if manytomany.joinTable??>
		    joinTable:
		      ${print(manytomany.joinTable.name!, "name")}
		      ${print(manytomany.joinTable.catalog!, "catalog")}
		      ${print(manytomany.joinTable.schema!, "schema")}   
		    <#if manytomany.joinTable.joinColumns??>
		    	<#list manytomany.joinTable.joinColumns as joinColumn>
		    	joinColumn:
		    		${print(joinColumn.name!, "name")}
		    		${print(joinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(joinColumn.unique!, "unique")}
		    		${print(joinColumn.nullable!, "nullable")}
		    		${print(joinColumn.insertable!, "insertable")}
		    		${print(joinColumn.updatable!, "updatable")}
		    		${print(joinColumn.columnDefinition!, "columnDefinition")}
		    		${print(joinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if manytomany.joinTable.inverseJoinColumns??>
		    	<#list manytomany.joinTable.inverseJoinColumns as inverseJoinColumn>
		    	inverseJoinColumn:
		    		${print(inverseJoinColumn.name!, "name")}
		    		${print(inverseJoinColumn.referencedColumnName!, "referencedColumnName")}
		    		${print(inverseJoinColumn.unique!, "unique")}
		    		${print(inverseJoinColumn.nullable!, "nullable")}
		    		${print(inverseJoinColumn.insertable!, "insertable")}
		    		${print(inverseJoinColumn.updatable!, "updatable")}
		    		${print(inverseJoinColumn.columnDefinition!, "columnDefinition")}
		    		${print(inverseJoinColumn.table!, "table")}
		    	</#list>
		    </#if>	
		    <#if manytomany.joinTable.uniqueConstraints??>
			  	<#list manytomany.joinTable.uniqueConstraints as uc>
			   	uniqueConstraints:
			   		${print(uc!, "columnNames")}
			   	</#list>
			  </#if>   
			</#if>    	  
    	</#list>
    </#if>				
  </#list>
  </#if>          
</#if>    
        